package com.rxz.controller;

import com.rxz.entity.Result;
import com.rxz.service.impl.MqServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("mq")
public class MqController {

    @Autowired
    private MqServiceImpl mqService;

    @PostMapping("/send")
    public Result sendMQ(@RequestParam("message") String message){
        return mqService.sendMQ(message);
    }

    @GetMapping("/get")
    public Result getMQ(@RequestParam("key") String key,@RequestParam("index") int index){
        return mqService.getMQ(key,index);
    }
}
